package com.luoling.download;

import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.luoling.zipRead.ZipRead;

import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.List;

/**
 * Description:
 * Copyright:   Copyright (c)2024
 * Company:
 *
 * @author: 张李鑫
 * @version: 1.0
 * Create at:   2024-07-22 09:17:30
 * <p>
 * Modification History:
 * Date         Author      Version     Description
 * ------------------------------------------------------------------
 * 2024-07-22     张李鑫                     1.0         1.0 Version
 */
public class Process {
    private static ObjectMapper mapper = null;


    public static void main(String[] args) throws Exception {
        if (args.length == 0) {
            System.out.println("参数为空");
            return;
        }
        mapper = new ObjectMapper();
        mapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"));
//        mapper.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE);
        mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);


        //        zipSqlFile("单位-表内.sql", preStr);
//        String path = ZipRead.zipSqlFile("单位-表内.sql", ZipRead.preStr);
//        System.out.println(path);


        Upload.UploadForm uploadForm = Upload.readConfig(args);
        HashMap<String, String> params = new HashMap<>();
        params.put("Cookie", uploadForm.getCookie());
        params.put("Referer", uploadForm.getRef());
        params.put("X-Auth-Token", uploadForm.getAuthToken());
        params.put("User-Agent", uploadForm.getUserAgent());

//        List<DownLoadDetailSql.Model> models = Upload.upload(path, uploadForm, params);
//        System.out.println(models);

//        Upload.click(models, params);
    }

}
